// Setup the LDC tx pin and clear display
void init_SoftSerial(){
  // Set the data rate for the software serial port
  LCD.begin(9600);
  backlightOn();
  clearLCD();
}


void updateDisplay(){

//  unsigned long currentMillis = millis();

  if(millis() - prevMillis_LCDupdate > LCDrefreshRate){ 
    
    clearLCD();

    LCD.print("Temp: ");
    LCD.print(fridgeTemp1*0.01);
    
    selectLineTwo();
    
    LCD.print("Set Temp: ");  
    LCD.print(fridgeSetTemp1 * 0.01);
  
  prevMillis_LCDupdate = millis(); // reset refresh timer
}
}


void clearLCD(){

  LCD.write(0xFE);   //command flag
  LCD.write(0x01);   //clear command.
  selectLineOne();
  delay(LCDdelay);
}

void selectLineOne(){  //puts the cursor at line 0 char 0.
  LCD.write(0xFE);   //command flag
  LCD.write(128);    //position
  delay(LCDdelay);
}

void selectLineTwo(){  //puts the cursor at line 0 char 0.
  LCD.write(0xFE);   //command flag
  LCD.write(192);    //position
  delay(LCDdelay);
}

void backlightOn() {  //turns on the backlight
  LCD.write(0x7C);   //command flag for backlight stuff
  LCD.write(157);    //light level.
  delay(LCDdelay);


}

